package lab01;


public class test05 {
    public static void main(String[] args) {

        int n = Integer.parseInt(args[0]);
        int sum = 0;

//for
        for (int i = 1; i <= n; i++) {
            sum += i;
        }
        System.out.println(sum);

//while
        int i = 1;
        sum = 0;
        while (i <= n) {
            sum += i;
            i++;
        }
        System.out.println(sum);
//do-while
        i = 1;
        sum = 0;
        do {
            sum += i;
            i++;
        } while (i <= n);
        System.out.println(sum);
    }
}


